﻿@model IEnumerable<ConsoleApplication2.Models.PayingCustomer>

@{
    ViewBag.Title = "الزبائن المنقطعون";
}



<div>
    <form action="">
        الانقطاع من تاريخ :     @Html.TextBox("fromDate", ViewData["fromDate"]);

        <input type="submit" value="send" />
    </form>

</div>
<div>


</div>
@{
    // csharp code block
    // everything in here is code, don't have to use @
    int counter = 1;
    double sum = 0;
    double discount = 0;
}


<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
    <thead>
        <tr>
            <th scope="col" class="rounded-company"></th>
            <th scope="col" class="rounded">رقم الملف</th>
            <th scope="col" class="rounded">
                الأسم العربي
            </th>
            <th scope="col" class="rounded"> الأسم الانجليزي</th>
            <th scope="col" class="rounded"> رقم الجوال</th>
            <th scope="col" class="rounded"> قبل الخصم</th>
            <th scope="col" class="rounded"> المدفوع بعد الخصم</th>
            <th scope="col" class="rounded"> أخر عمليه</th>

        </tr>
    </thead>

    <tbody>
        @foreach (var item in Model)
        {

            <tr>

                <td>
                    @counter
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>  @Html.DisplayFor(modelItem => item.patID)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>  @Html.DisplayFor(modelItem => item.arabic_name)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>  @Html.DisplayFor(modelItem => item.full_name)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>   @Html.DisplayFor(modelItem => item.mobile)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>    @Html.DisplayFor(modelItem => item.total)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>     @Html.DisplayFor(modelItem => item.discounted)</a>
                </td>
                <td>
                    <a href='Details?custid=@item.patID&toDate= @ViewData["fromDate"]&fromDate= @ViewData["fromDate"]'>   @Html.DisplayFor(modelItem => item.lastActive)</a>
                </td>


            </tr>
            sum = sum + @item.total;
            discount = discount + @item.discounted;
            counter++;
        }
    </tbody>
    <tfoot>
        <tr>
            <td colspan="6" class="rounded-foot-left">
                <em>
                    @{
                        int sum2 = (int)sum;
                        int discount2 = (int)discount;

                    }


                    مجموع الدخل قبل الخصم: @sum2
                    -
                    مجموع الدخل بعد الخصم: @discount2


                </em>
            </td>
            <td class="rounded-foot-right">&nbsp;</td>

        </tr>
    </tfoot>
</table>





